﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Luna小店.DTO
{
    public class 面料导入DTO
    {
        public String MATERIAL_ID { get; set; }
        public String MATERIAL_CODE{get; set;}
        public String MATERIAL_CATEGORY { get; set; }
        public String MATERIAL_NAME_CN { get; set; }
        public String MATERIAL_SPEC { get; set; }
        public String MATERIAL_UNIT_CD { get; set; }
        public String MATERIAL_GRAM_WEIGHT { get; set; }
        public String MATERIAL_YEAR { get; set; }
        public String MATERIAL_SEASON { get; set; }
        public String MATERIAL_COMPOSITION { get; set; }
        public String MATERIAL_WEAVE { get; set; }
        public String MATERIAL_COLOR { get; set; }
        public String MATERIAL_STYLE { get; set; }
        public String MATERIAL_THREAD_COUNT { get; set; }
        public String MATERIAL_OTHER1 { get; set; }
        public String MATERIAL_LEVEL { get; set; }
        public String MATERIAL_OTHER2 { get; set; }
        public String MATERIAL_TYPE_CD { get; set; }
        public Boolean isConflict { get; set; }

        public 面料导入DTO(String MATERIAL_CODE, String MATERIAL_CATEGORY, String MATERIAL_NAME_CN, String MATERIAL_SPEC, String MATERIAL_UNIT_CD, String MATERIAL_GRAM_WEIGHT, String MATERIAL_YEAR, String MATERIAL_SEASON, String MATERIAL_COMPOSITION, String MATERIAL_WEAVE, String MATERIAL_COLOR, String MATERIAL_STYLE, String MATERIAL_THREAD_COUNT, String MATERIAL_OTHER1, String MATERIAL_LEVEL, String MATERIAL_OTHER2, String MATERIAL_TYPE_CD) {
            this.MATERIAL_CODE = MATERIAL_CODE;
            this.MATERIAL_CATEGORY = MATERIAL_CATEGORY;
            this.MATERIAL_NAME_CN = MATERIAL_NAME_CN;
            this.MATERIAL_SPEC = MATERIAL_SPEC;
            this.MATERIAL_UNIT_CD = MATERIAL_UNIT_CD;
            this.MATERIAL_GRAM_WEIGHT = MATERIAL_GRAM_WEIGHT;
            this.MATERIAL_YEAR = MATERIAL_YEAR;
            this.MATERIAL_SEASON = MATERIAL_SEASON;
            this.MATERIAL_COMPOSITION = MATERIAL_COMPOSITION;
            this.MATERIAL_WEAVE = MATERIAL_WEAVE;
            this.MATERIAL_COLOR = MATERIAL_COLOR;
            this.MATERIAL_STYLE = MATERIAL_STYLE;
            this.MATERIAL_THREAD_COUNT = MATERIAL_THREAD_COUNT;
            this.MATERIAL_OTHER1 = MATERIAL_OTHER1;
            this.MATERIAL_LEVEL = MATERIAL_LEVEL;
            this.MATERIAL_OTHER2 = MATERIAL_OTHER2;
            this.MATERIAL_TYPE_CD = MATERIAL_TYPE_CD;
            this.isConflict = true;
        }

        public 面料导入DTO(DataRow dataRow)
        {
            this.MATERIAL_ID = dataRow["MATERIAL_ID"].ToString();
            this.MATERIAL_CODE = dataRow["MATERIAL_CODE"].ToString();
            this.MATERIAL_CATEGORY = dataRow["MATERIAL_CATEGORY"].ToString();
            this.MATERIAL_NAME_CN = dataRow["MATERIAL_NAME_CN"].ToString();
            this.MATERIAL_SPEC = dataRow["MATERIAL_SPEC"].ToString();
            this.MATERIAL_UNIT_CD = dataRow["MATERIAL_UNIT_CD"].ToString();
            this.MATERIAL_GRAM_WEIGHT = dataRow["MATERIAL_GRAM_WEIGHT"].ToString();
            this.MATERIAL_YEAR = dataRow["MATERIAL_YEAR"].ToString();
            this.MATERIAL_SEASON = dataRow["MATERIAL_SEASON"].ToString();
            this.MATERIAL_COMPOSITION = dataRow["MATERIAL_COMPOSITION"].ToString();
            this.MATERIAL_WEAVE = dataRow["MATERIAL_WEAVE"].ToString();
            this.MATERIAL_COLOR = dataRow["MATERIAL_COLOR"].ToString();
            this.MATERIAL_STYLE = dataRow["MATERIAL_STYLE"].ToString();
            this.MATERIAL_THREAD_COUNT = dataRow["MATERIAL_THREAD_COUNT"].ToString();
            this.MATERIAL_OTHER1 = dataRow["MATERIAL_OTHER1"].ToString();
            this.MATERIAL_LEVEL = dataRow["MATERIAL_LEVEL"].ToString();
            this.MATERIAL_OTHER2 = dataRow["MATERIAL_OTHER2"].ToString();
            this.MATERIAL_TYPE_CD = dataRow["MATERIAL_TYPE_CD"].ToString();
            this.isConflict = true;
        }

        /// <summary>
        /// 更新物料ID和是否冲突
        /// </summary>
        /// <param name="MATERIAL_ID"></param>
        /// <param name="isConflict"></param>
        /// <returns></returns>
        public 面料导入DTO buildConflict(Boolean isConflict) {
            this.isConflict = isConflict;
            return this;
        }
    }
}
